From 6fab0f535479695790c71398ccb1ac2bdad893bc Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 6 Sep 2018 13:12:46 +0200 Subject: [PATCH] simplify cmake usage by nana-demo including nana --- .gitignore | 1 + .travis.yml | 7 ------- CMakeLists.txt | 8 ++++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 6bd33ab0..003f80b0 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ lib/ CMakeCache.txt CMakeFiles/ cmake-build-debug/ +cmake-build-*/ .idea/ cmake_install.cmake *.DS_Store diff --git a/.travis.yml b/.travis.yml index 69624c16..09436717 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,18 +56,11 @@ before_script : - sleep 3 # give xvfb some time to start # we have: qPCR4vir/nana/../nana-demo and now we are in: qPCR4vir/nana/ our executable tests will access: ../nana-demo/Examples/*.bmp etc.(need to be in parallel with nana-demo/Examples) #- cd ../nana-demo - - mkdir ../nana_lib - - mkdir ../nana_demo_bin - cd ../nana_lib - mkdir bin - cd bin script: - # Installing: the static "nana lib" will be in DESTDIR/CMAKE_INSTALL_PREFIX/lib/ - # and the includes files "nana" in DESTDIR/CMAKE_INSTALL_PREFIX/include/ - # we are in "... nana/../nana_lib/bin/" we need "../../nana" to get the CMakeList.txt of nana. - # Thus, make install will put the nana.lib in "... nana/../nana_lib/lib/" - # and the includes in "... nana/../nana_lib/include/" - cmake -G"Unix Makefiles" ../../nana -DCMAKE_INSTALL_PREFIX=.. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_ENABLE_PNG=OFF -DNANA_CMAKE_BUILD_DEMOS=ON -DNANA_CMAKE_ENABLE_AUDIO=OFF -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_BOOST_FILESYSTEM_FORCE=OFF -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON - make install - ls diff --git a/CMakeLists.txt b/CMakeLists.txt index 304a446f..6a2622c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ # https://cliutils.gitlab.io/modern-cmake/ # https://cmake.org/cmake-tutorial/ -# https://cmake.org/cmake/help/v3.13/module/CMakeDependentOption.html?highlight=cmakedependentoption +# https://cmake.org/cmake/help/v3.12/module/CMakeDependentOption.html?highlight=cmakedependentoption # use CACHE FORCE or set(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ ON) or delete CMakecache.txt or the entirely build dir # if your changes don't execute # It seems that project() defines essential system variables like CMAKE_FIND_LIBRARY_PREFIXES. @@ -312,7 +312,7 @@ if(NANA_CMAKE_ENABLE_PNG) if(PNG_FOUND) target_include_directories(nana PRIVATE ${PNG_INCLUDE_DIRS}) target_compile_options (nana PRIVATE ${PNG_LIBRARIES}) - target_compile_definitions(nana PRIVATE NANA_ENABLE_PNG USE_LIBPNG_FROM_OS) + target_compile_definitions(nana PUBLIC NANA_ENABLE_PNG USE_LIBPNG_FROM_OS) endif() else() target_compile_definitions(nana PRIVATE NANA_ENABLE_PNG) @@ -326,7 +326,7 @@ if(NANA_CMAKE_ENABLE_JPEG) if(JPEG_FOUND) target_include_directories(nana PRIVATE ${JPEG_INCLUDE_DIR}) target_compile_options (nana PRIVATE ${JPEG_LIBRARY}) - target_compile_definitions(nana PRIVATE NANA_ENABLE_JPEG USE_LIBJPEG_FROM_OS) + target_compile_definitions(nana PUBLIC NANA_ENABLE_JPEG USE_LIBJPEG_FROM_OS) endif() else() target_compile_definitions(nana PRIVATE NANA_ENABLE_JPEG) @@ -335,7 +335,7 @@ endif() # Find ASOUND if(NANA_CMAKE_ENABLE_AUDIO) - target_compile_definitions(nana PRIVATE NANA_ENABLE_AUDIO) + target_compile_definitions(nana PUBLIC NANA_ENABLE_AUDIO) if(UNIX) find_package(ASOUND) if(ASOUND_FOUND)