summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Spangberg <daniels@kemi.uu.se>2013-05-17 17:51:38 (GMT)
committerDaniel Spangberg <daniels@kemi.uu.se>2013-05-17 17:51:38 (GMT)
commit47bc4acb6a7373a359b3b3a73302ebd985dedd1b (patch)
tree562e98b6b14d093a6cecd7c9b26b2c3f99410634 /src
parente9d08c77cbf705b012846eb837341b526e1a058b (diff)
Only add math library on UNIX. Copy .sh files on UNIX. Copy .bat files on windows.
Diffstat (limited to 'src')
-rw-r--r--src/compression/CMakeLists.txt4
-rw-r--r--src/tests/CMakeLists.txt11
-rw-r--r--src/tests/compression/CMakeLists.txt8
3 files changed, 21 insertions, 2 deletions
diff --git a/src/compression/CMakeLists.txt b/src/compression/CMakeLists.txt
index 35e01f7..605dac7 100644
--- a/src/compression/CMakeLists.txt
+++ b/src/compression/CMakeLists.txt
@@ -5,4 +5,6 @@ include_directories(${COMP_INC_DIR})
set(HEADER_FILES ${COMP_INC_DIR}/bwlzh.h ${COMP_INC_DIR}/bwt.h ${COMP_INC_DIR}/coder.h ${COMP_INC_DIR}/dict.h ${COMP_INC_DIR}/fixpoint.h ${COMP_INC_DIR}/huffman.h ${COMP_INC_DIR}/lz77.h ${COMP_INC_DIR}/merge_sort.h ${COMP_INC_DIR}/mtf.h ${COMP_INC_DIR}/my64bit.h ${COMP_INC_DIR}/rle.h ${COMP_INC_DIR}/tng_compress.h ${COMP_INC_DIR}/vals16.h ${COMP_INC_DIR}/warnmalloc.h ${COMP_INC_DIR}/widemuldiv.h)
add_library(tng_compress SHARED bwlzh.c bwt.c coder.c dict.c fixpoint.c huffman.c huffmem.c lz77.c merge_sort.c mtf.c rle.c tng_compress.c vals16.c warnmalloc.c widemuldiv.c xtc2.c xtc3.c)
-target_link_libraries(tng_compress m) \ No newline at end of file
+if(UNIX)
+target_link_libraries(tng_compress m)
+endif()
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 6320769..42de927 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -12,7 +12,9 @@ configure_file(${TRAJECTORY_SOURCE_DIR}/include/tng_io_testing.h.in ${CMAKE_BINA
include_directories(${CMAKE_BINARY_DIR}/generated/)
add_executable(tng_testing tng_io_testing.c)
+if(UNIX)
target_link_libraries(tng_testing tng_io m)
+endif()
if(HAVE_INTTYPES_H)
set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1)
@@ -20,14 +22,21 @@ endif()
if(OPENMP_FOUND)
add_executable(md_openmp md_openmp.c)
- target_link_libraries(md_openmp tng_io ${OpenMP_LIBS} m)
+ target_link_libraries(md_openmp tng_io ${OpenMP_LIBS})
+ if(UNIX)
+ target_link_libraries(md_openmp m)
+ endif()
endif()
add_executable(tng_io_read_pos tng_io_read_pos.c)
+if(UNIX)
target_link_libraries(tng_io_read_pos tng_io m)
+endif()
add_executable(tng_parallel_read tng_parallel_read.c)
+if(UNIX)
target_link_libraries(tng_parallel_read tng_io m)
+endif()
if(BUILD_FORTRAN)
# This does not work due to a bug in CMake. Remove lines below if no fortran compiler is found.
diff --git a/src/tests/compression/CMakeLists.txt b/src/tests/compression/CMakeLists.txt
index 694d27b..33dfb61 100644
--- a/src/tests/compression/CMakeLists.txt
+++ b/src/tests/compression/CMakeLists.txt
@@ -16,21 +16,29 @@ while( number LESS ${numtests})
math( EXPR number "${number} + 1" )
add_executable(test_tng_compress_gen${number} testsuite.c)
+if(UNIX)
target_link_libraries(test_tng_compress_gen${number} tng_compress m)
+endif()
list(APPEND gen${number}_build_definitions GEN)
list(APPEND gen${number}_build_definitions TESTPARAM="test${number}.h")
set_target_properties(test_tng_compress_gen${number} PROPERTIES COMPILE_DEFINITIONS "${gen${number}_build_definitions}")
add_dependencies(test_tng_compress_gen${number} test${number}.h)
add_executable(test_tng_compress_read${number} testsuite.c)
+if(UNIX)
target_link_libraries(test_tng_compress_read${number} tng_compress m)
+endif()
list(APPEND read${number}_build_definitions TESTPARAM="test${number}.h")
set_target_properties(test_tng_compress_read${number} PROPERTIES COMPILE_DEFINITIONS "${read${number}_build_definitions}")
add_dependencies(test_tng_compress_read${number} test${number}.h)
endwhile()
+if(UNIX)
file(COPY test_tng_compress_write.sh DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY test_tng_compress_read.sh DESTINATION ${CMAKE_BINARY_DIR}/bin)
+endif()
+if(WIN32)
file(COPY test_tng_compress_write.bat DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY test_tng_compress_read.bat DESTINATION ${CMAKE_BINARY_DIR}/bin)
+endif()
contact: Jan Huwald // Impressum